package cn.wx.scholar.neo4j.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cn.wx.common.persistence.base.BaseController;
import cn.wx.common.persistence.web.ResponseData;
import cn.wx.scholar.neo4j.entity.qo.ExpertQ;
import cn.wx.scholar.neo4j.service.OrgService;

/**
 *   @description : org  控制器
 *   ---------------------------------
 *   @author  
 *   @since 2018-07-17
 */
@RestController
@RequestMapping("/sholar/org")
public class OrgController extends BaseController {
	@Autowired
    private OrgService orgService;
	
    /**
     * 根据专家Id查询关联机构
     * @param id
     * @return
     */
    @RequestMapping(value = "/getRelateOrg", method = RequestMethod.POST)
	public ResponseData getRelateOrg(@RequestParam(value="id") Long id){
		return success(orgService.getRelateOrg(id));
    }
    
    /**
	 * 查询机构列表
	 * 
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "/getOrgByKey", method = RequestMethod.POST)
	public ResponseData findByQueryParam(ExpertQ expertQ) {
		return success(orgService.loadOrgByQueryExperts2(expertQ));
	}

}
